#ifndef CACHE_MANAGER_H
#define CACHE_MANAGER_H

#include <glib.h>
#include <stdbool.h> // <-- 关键修复：包含头文件
#include "utils.h"

typedef struct {
    char *disk_cache_dir;
    GHashTable *lba_map;
} cache_manager_t;

cache_manager_t* cache_manager_create(const char* disk_cache_dir, const char* lba_map_path);
void cache_manager_destroy(cache_manager_t* cm);

const char* cache_manager_get_hash(cache_manager_t* cm, long long lba);
bool cache_manager_read_from_disk(cache_manager_t* cm, const char* hash, void* buffer);
bool cache_manager_write_to_disk(cache_manager_t* cm, const char* hash, const void* data, size_t size);

#endif